import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx.room.TypeConverters
import com.yourname.myapplication.data.local.Dao.QuestionDao
import com.yourname.myapplication.data.local.converters.ListConverter
import com.yourname.myapplication.data.local.entity.QuestionEntity

@Database(entities = [QuestionEntity::class], version = 1)
@TypeConverters(ListConverter::class)
abstract class AppDatabase : RoomDatabase() {
    abstract fun questionDao(): QuestionDao

    companion object {
        fun create(context: Context): AppDatabase {
            return Room.databaseBuilder(
                context,
                AppDatabase::class.java,
                "question_db"
            ).build()
        }
    }
}